<!--suppress ThymeleafVariablesResolveInspection -->
<html xmlns:th="http://www.thymeleaf.org" th:fragment="content">
<style>
    #transferOrderPrint th, #transferOrderPrint td, .midTable th, .midTable td {
        width: 300px;
        text-align: center;
    }

    .layui-table th {
        font-weight: bold;
    }
    .layui-table td, .layui-table th {
        position: relative;
         padding: 0 !important;
        min-height: 20px;
        line-height: 20px;
        font-size: 10px !important;
    }
    .member_purchase_print_content h1 {
        text-align: center;
        padding: 0px 0px 50px;
    }
    .layui-table, .layui-table-view {
         margin: auto !important;
    }
    .member_purchase_print_content {
        max-width: 1433px;
/*
        padding: 10px;
*/
        background-color: #FFFFFF;
        font-size: 14px;
    }
</style>
<div th:replace="fragments/header :: header">Header</div>
<body>
<div class="layui-header" style="display: none;">
    <div th:replace="fragments/menu"></div>
</div>
<div class="member_purchase_print_content ">

    <input data-type="gomroInvoicePrint" name="btn" th:type="${(a==0)?'button':'hidden'}"
           class="layui-btn layui-btn-normal layui-btn-sm"
           value="打印">
    <h1 style="padding: 10px;" th:text="${orders[0].platformName=='上海固买供应链管理有限公司'?'上海固买':'南阳固买'}"></h1>
    <h2 style="padding: 10px;">云平台转采收票单</h2>
    <table class="layui-table" id="transferOrderPrint">
        <thead>
        <tr>
            <th>采购合同编号</th>
            <th>供货商</th>
            <th>平台组织名称</th>
            <th>采购日期</th>
            <th>采购金额(元)</th>
            <th>收票金额(元)</th>
        </tr>
        </thead>
        <tbody th:each="order:${orders}">
        <tr>
            <td th:text="${order.poCode}"></td>
            <td th:text="${order.transferVendorName}"></td>
            <td th:text="${order.platformName}"></td>
            <td th:text="${#strings.substring(order.time,0,10)}"></td>
            <td th:text="${#numbers.formatDecimal(order.purchaseAmount,1,2)}"></td>
            <td th:text="${#numbers.formatDecimal(order.invoicePrice,1,2)}"></td>
        </tr>
        </tbody>
        <tfoot>
        <tr>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th>采购总金额:</th>
            <th th:text="${#numbers.formatDecimal(purchaseInvoices.purchaseAmount,1,2)}"></th>
        </tr>
        <tr>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th>收票总金额:</th>
            <th th:text="${#numbers.formatDecimal(purchaseInvoices.invoiceAmount,1,2)}"></th>
        </tr>
        </tfoot>
    </table>
    <table class="layui-table" style="margin-top:10px !important;">
        <thead>
        <tr>
            <th style="width:301px;text-align: center;"><b>发票抬头:</b></th>
            <th style="width:301px;text-align: center;" th:text="${purchaseInvoices.title}"></th>
            <th style="width:300px;text-align: center;"><b>发票税率：</b></th>
            <th style="width:300px;text-align: center;" th:text="${purchaseInvoices.invoiceRate}"></th>
        </tr>
        </thead>
    </table>
    <table class="layui-table" id="transferOrderDetail" style="margin:-11px auto 10px">
        <thead>
        <tr>
            <th style="text-align: center">发票号码</th>
            <th style="text-align: center">发票金额(含)</th>
            <th style="text-align: center">发票金额(未)</th>
            <th style="text-align: center">税额(元)</th>
            <th style="text-align: center">补差金额(未)</th>
            <th style="text-align: center">收票日期</th>
            <th style="text-align: center">财务确认时间</th>
            <th style="text-align: center">收票人</th>
            <th style="text-align: center">备注</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="purchaseInvoice:${purchaseInvoices.purchaseInvoiceDetailList}">
            <td style="text-align: center" th:text="${purchaseInvoice.invoiceNumber}"></td>
            <td style="text-align: center" th:text="${#numbers.formatDecimal(purchaseInvoice.invoicePrice,1,2)}"></td>
            <td style="text-align: center"
                th:text="${#numbers.formatDecimal(purchaseInvoice.preInvoicePrice,1,2)}"></td>
            <td style="text-align: center" th:text="${#numbers.formatDecimal(purchaseInvoice.taxAmount,1,2)}"></td>
            <td style="text-align: center" th:text="${#numbers.formatDecimal(purchaseInvoice.balanceAmount,1,2)}"></td>
            <td style="text-align: center" th:text="${#strings.substring(purchaseInvoice.invoiceTime,0,10)}"></td>
            <td style="text-align: center"
                th:text="${#strings.substring(financialConfirmTime,0,10)}"></td>
            <td style="text-align: center" th:text="${invoiceApply}"></td>
            <td style="text-align: center" th:text="${purchaseInvoice.memo}"></td>
        </tr>
        </tbody>
    </table>
</div>
<script th:src="${cdn}+'/static/js/purchase_management/purchase_invoice_print.js' + ${ver}"></script>
</body>
</html>
